package com.maserb.monitor.repository.schoolStudent;

import com.maserb.monitor.entity.SysCode;
import com.maserb.monitor.entity.schoolStudent.StudentAchieveEntity;
import com.maserb.monitor.entity.schoolStudent.StudentScoreEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentScoreRepository extends JpaSpecificationExecutor<StudentScoreEntity>
        , PagingAndSortingRepository<StudentScoreEntity, String> {
    List<StudentScoreEntity> findByAchieve(StudentAchieveEntity achieve);

    StudentScoreEntity findFirstByAchieveAndSubject(StudentAchieveEntity achieve, SysCode subject);

    List<StudentScoreEntity> findByAchieveOrderByScoreDesc(StudentAchieveEntity achieve);

}